package bean;

import java.util.ArrayList;
import bean.S_Course;
import Dao.SDao;

public class Student {
	private String stu_id;
	private String stu_name;
	private String stu_pwd;
	private String stu_sex;
	private String g_id;
	private Double grade;
	private ArrayList<S_Course> course = new ArrayList<S_Course>();
	private ArrayList<S_Class> cla = new ArrayList<S_Class>();

	public Student(){}
	
	public Double getGrade() {
		return grade;
	}

	public void setGrade(Double grade) {
		this.grade = grade;
	}
	public String getStu_id() {
		return stu_id;
	}
	public void setStu_id(String stu_id) {
		this.stu_id = stu_id;
	}
	public String getStu_name() {
		return stu_name;
	}
	public void setStu_name(String stu_name) {
		this.stu_name = stu_name;
	}
	public String getStu_pwd() {
		return stu_pwd;
	}
	public void setStu_pwd(String stu_pwd) {
		this.stu_pwd = stu_pwd;
	}
	public String getStu_sex() {
		return stu_sex;
	}
	public void setStu_sex(String stu_sex) {
		this.stu_sex = stu_sex;
	}
	public String getG_id() {
		return g_id;
	}
	public void setG_id(String g_id) {
		this.g_id = g_id;
	}
	public ArrayList<S_Course> getCourse() {
		return course;
	}
	public void setCourse(ArrayList<S_Course> course) {
		this.course = course;
	}
	public ArrayList<S_Class> getCla() {
		return cla;
	}

	public void setCla(ArrayList<S_Class> cla) {
		this.cla = cla;
	}
	
	public void setClass(String cla_id ,String cla_name) {

		S_Class cla = new S_Class();
		cla.setCla_id(cla_id);
		cla.setCla_name(cla_name);
		this.cla.add(cla);
	}
	
	public void TsetCourses(String c_name , double grade ,String c_id) {

		S_Course cou = new S_Course();
		cou.setC_name(c_name);
		cou.setC_id(c_id);
		cou.setGrade(grade);
		this.course.add(cou);
	}
	
	public void setCourses(String c_name , double grade , double gpa ,double c_point) {

		S_Course cou = new S_Course();
		cou.setC_name(c_name);
		cou.setGrade(grade);
		cou.setGpa(gpa);
		cou.setC_point(c_point);
		this.course.add(cou);
	}
	
	public void setClaTab(String c_name ,String c_time , double c_point , String tea_name ) {

		S_Course cou = new S_Course();
		cou.setC_name(c_name);
		cou.setC_point(c_point);
		cou.setC_time(c_time);
		cou.setTea_name(tea_name);
		this.course.add(cou);
	}
	
	public Student ScoreForGrade(String stu_id) throws Exception
	{
		SDao s = new SDao();
		Student stu = s.GetStuSco(stu_id);
		return stu;
	}
	
	public Student ChangeGrade(String stu_id,String g_id) throws Exception
	{
		SDao s = new SDao();
		Student stu = s.ChangeGrade(stu_id,g_id);
		return stu;
	}
	
	public Student StuClassTable(String stu_id) throws Exception
	{
		SDao s = new SDao();
		Student stu = s.StuClassTable(stu_id);
		return stu;
	}
	public Student StuClaTab(String stu_id , String g_id) throws Exception
	{
		SDao s = new SDao();
		Student stu = s.StuClaTab(stu_id , g_id);
		return stu;
	}
}
